package com.hk.card;

public class CardTake {
	private static CardTake cardtake;
	private TakenCardCom tcc = TakenCardCom.getCardsOfCom();
	private TakenCardUser tcu = TakenCardUser.getCardsOfUser();
	private TakenCardUserSplit tcus = TakenCardUserSplit.getCardsOfSplit();
	private CardCase cc = CardCase.getCardCase();
	
	public static CardTake getPreocess() {
		if (cardtake==null) {	cardtake = new CardTake();	}
		return cardtake;		
	}
	public void CardCaseSet() {
		cc.CardSet();
	}
	public boolean ComTake() {
		if (tcc.getSum()<17) {
			tcc.SetCard();
		}
		if (tcc.getSum()<=21) {
			return true;
		}
		return false;
	}
	public boolean UserTake() {
		if (tcu.getSum()<=21) {
			tcu.SetCard();
		} 
		if (tcu.getSum()<=21) {
			return true;
		}
		return false;
	}
	public boolean SplitTake() {
		if (tcus.getSum()<=21) {
			tcus.SetCard();
		} 
		if (tcus.getSum()<=21) {
			return true;
		}
		return false;
	}
//	public boolean SplitCheck() {
//		if (tcu.getNumber(0)==tcu.getNumber(1)) {
//			return true;
//		}
//		return true;
//		return false;
//	}
	public void CardSplit() {
		tcu.CardSplit();
	}
	public void CardSet(int count) {
		for (int i = 0; i < count; i++) {
			tcc.AddCard();
			tcu.AddCard();
			tcus.AddCard();
		}
	}
	public void CardTakeReSet() {
		cc.CardSet();
		tcc.ReSet();
		tcu.ReSet();
		tcus.ReSet();
	}
	public TakenCardCom getTcc() {
		return tcc;
	}
	public TakenCardUser getTcu() {
		return tcu;
	}
	public TakenCardUserSplit getTcus() {
		return tcus;
	}
//	public TakenCardUser getCou() {
//		return cou;
//	}
//	public TakenCardUserSplit getCos() {
//		return cos;
//	}
//	public TakenCardCom getCoc() {
//		return coc;
//	}
}
